package com.dingyh.shopwebbackground.service.impl;

import com.dingyh.shopwebbackground.entity.AdsPost;
import com.dingyh.shopwebbackground.mapper.AdsPostMapper;
import com.dingyh.shopwebbackground.service.AdsPostService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author dingyuhan
 * @since 2023-02-22
 */
@Service
public class AdsPostServiceImpl extends ServiceImpl<AdsPostMapper, AdsPost> implements AdsPostService {

    @Autowired
    AdsPostMapper adsPostMapper;

    @Override
    public List<AdsPost> getAdsList() {
        return adsPostMapper.getAdsList() ;
    }

    @Override
    public boolean approvalAds(AdsPost adsPost) {
        try {
           return updateById(adsPost);
        }catch (Exception e){
            System.out.println(e);
            return false;
        }
    }
}
